package com.bangcommunity.bbframe.media;

import java.awt.*;

/**
 * @author tanghc
 * @date 18/7/2
 */
public class FontUtil {
    public static Point calculatePoint(int type,int outWidth,int outHeight,int width,int height){
        int x = 0,y = 0;
        if(type == 1){
            x = 10;
            y = 10;

        }else if(type == 2){
            x = outWidth - width - 10;
            y = 10;
        }else if(type == 3){
            x = 10;
            y = outHeight - height -10;
        }else if(type == 4){
            x = outWidth - width - 10;
            y = outHeight - height -10;
        }else if(type == 5){
            x = (outWidth - width)/2;
            y = (outHeight - height)/2 ;
        }
        return new Point(Math.min(x,outWidth),Math.min(y,outHeight));
    }
}
